package com.itheima.service.impl;

import com.itheima.mapper.UserMapper;
import com.itheima.pojo.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description:
 * @Version: V1.0
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> findAll() {
        return userMapper.findAll();
    }

    @Override
    public List<User> findByIds(List list) {
        List ids = new ArrayList();
        ids.add(2);
        ids.add(3);
        User user  = new User();
        user.setIds(ids);

        return userMapper.findByIds(user);
    }

    @Override
    public List<User> findByListIds(List list) {


        return userMapper.findByListIds(list);
    }

    @Override
    public void updateGenders(List ids) {
        userMapper.updateGenders(ids);
    }

    @Override
    public void addUsers(List<User> users) {
        userMapper.addUsers(users);
    }

    @Override
    public void deleteByIds(List ids) {
        userMapper.deleteByIds(ids);
    }
}
